package haltica.com.mx.ape.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooEntity(versionField = "", table = "requerimientos")
public class Requerimientos {
	@Id
	@TableGenerator(name = "GEN_REQ", table = "sequence", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "SEQ_REQ", allocationSize = 1)
	@GeneratedValue(strategy=GenerationType.TABLE, generator="GEN_REQ")
    @Column(name = "ID_REQ")
    private Integer idReq;
	
	@ManyToOne
    @JoinColumn(name = "ID_TECLADO_ESCLUSA", referencedColumnName = "ID_TECLADO_ESCLUSA", nullable = false)
    private TecladoEsclusa idTecladoEsclusa;
    
    @ManyToOne
    @JoinColumn(name = "ID_EMPLEADO_SUC_TEC", referencedColumnName = "ID_EMPLEADO_SUC_TEC", nullable = false)
    private EmpleadoSucursalTeclado idEmpleadoSucTec;
    
    @ManyToOne
    @JoinColumn(name = "ID_TIPO_OPER", referencedColumnName = "ID_TIPO_OPER", nullable = false)
    private TipoOperacion idTipoOper;
    
    @Column(name = "NUM_IMEI", length = 15)
    private String numImei;
    
    @Column(name = "ACTIVO")
    @NotNull
    private Boolean activo;
    
    @Column(name = "FECHA_CREACION")
    @NotNull
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "M-")
    private Date fechaCreacion;
    
    @Column(name = "ID_USUARIO_AUTORIZO")
    private Integer idUsuarioAutorizo;
    
    @Column(name = "AUTORIZADO")
    private Boolean autorizado;
    
    @Column(name = "FECHA_AUTORIZACION")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "M-")
    private Date fechaAutorizacion;
}
